<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta name="format-detection" content="telephone=no,email=no"/>
    <meta name="apple-mobile-web-app-title" content="足彩"/>
    <title></title>
    <!--font-awsome-css-->
    <link rel="stylesheet" href="../public/styles/font-awesome.min.css">
    <!--bootstrap-->
    <link rel="stylesheet" href="../public/styles/bootstrap.min.css">
    <!--custom css-->
    <link rel="stylesheet" href="../public/styles/jquery-ui.css" />
    <link rel="stylesheet" type="text/css" href="../public/styles/index.css" />
    <link rel="stylesheet" href="../public/styles/common.css">


</head>
<body>
    <div class="masthead pdng-stn1">
        <!-- 内容开始 -->
        <div class="phone-box wrap push">
            <div id="home" class="menu-notify" style="position: fixed;top: 0;width: 100%;height: 48px">
                <div class="profile-left">
                    <a href="javascript:history.go(-1);" class="menu-link"><i class="fa fa-chevron-left"></i></a>
                </div>
                <div class="Profile-mid logo">
                    <h1>
                        <span class="link transfer-title"></span>
                    </h1>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="usercenter" style="margin-top: 48px">
                <ul class="oper-list" id="res-transfer"></ul>
                <script type="text/template" charset="utf-8" id="tpl-recharge">
                    {{? it.length}}
                        {{~ it:value:index}}
                        <li class="re-li">
                            <div class="pull-left">
                                <p class="t">Recharge Detail </p>
                                <p class="p">{{= $.dateFmt(value.createTime, "yyyy-MM-dd hh:mm")}}</p>
                            </div>
                            <div class="pull-right right">
                                <strong class="orange">{{= value.rechargeMoney}}</strong><br />
                                {{? value.rechargeState == "0"}}
                                    <span class="red">Failed</span>
                                {{?? value.rechargeState == "1"}}
                                    <span>Successful</span>
                                {{?}}
                            </div>
                        </li>
                        {{~}}
                    {{??}}
                        <div class="no-order">
                            <img src="../public/images/no-data.png">
                            <p>No Data</p>
                        </div>
                    {{?}}
                </script>
                <script type="text/template" charset="utf-8" id="tpl-withdraw">
                    {{? it.length}}
                        {{~ it:value:index}}
                        <li class="re-li">
                            <div class="pull-left">
                                <p class="t">Withdraw Detail </p>
                                <p class="p">{{= $.dateFmt(value.createTime, "yyyy-MM-dd hh:mm")}}</p>
                            </div>
                            <div class="pull-right right">
                                <strong class="orange">{{= value.cashMoney}}</strong><br />
                                {{? value.cashState == "1"}}
                                <span class="red">In Review</span>
                                {{?? value.cashState == "2"}}
                                <span>Successful</span>
                                {{?? value.cashState == "3"}}
                                <span>Failed</span>
                                {{?}}
                            </div>
                        </li>
                        {{~}}
                    {{??}}
                        <div class="no-order">
                            <img src="../public/images/no-data.png">
                            <p>No Data</p>
                        </div>
                    {{?}}
                </script>
            </div>
        </div>
    </div>



    <script type="text/javascript" src="../public/scripts/vendor/jquery-2.1.4.min.js"></script>
    <script type="text/javascript" src="../public/scripts/vendor/bootstrap.min.js"></script>
    <script type="text/javascript" src="../public/scripts/vendor/jquery.cookie.js"></script>
    <script type="text/javascript" src="../public/scripts/vendor/doT.min.js"></script>
    <script type="text/javascript" src="../public/scripts/common.js"></script>

    <script type="text/javascript">
        $(document).ready(function() {
            var t1 = $.cookie('t1');
            var t2 = $.cookie('t2');
            var flag = $.cookie('flag');
            $.ajax({
                type: 'get',
                url: apiDomain + '/rechargeInfo/findAllRechargeInfo?' + new Date().getTime(),
                dataType: "json",
                cache: false,
                data: {userId: $.cookie('userId'), staTime: t1, endTime: t2, flag: flag},
                success: function (data) {
                    if (data.code == "0") {
                        if(flag == "2"){
                            // 渲染充值
                            var tpl = doT.template($("#tpl-recharge").html());
                            $("#res-transfer").html(tpl(data.results.rechargeInfoList));
                            $('.transfer-title').html('Recharge Details');
                        }else if(flag == "3"){
                            // 渲染提现
                            var tpl = doT.template($("#tpl-withdraw").html());
                            $("#res-transfer").html(tpl(data.results.cashInfoList));
                            $('.transfer-title').html('Withdraw Details');
                        }

                    } else {

                    }
                }
            })

        });

    </script>
</body>
</html>